﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UIT.Animations;
using UIT.Style;

namespace UIT.Web.Renderers.Animations
{
    public class UnitAnimationRenderer : WebAnimationRenderer<UnitAnimation>
    {
        public override void Render(UnitAnimation animation)
        {
            Unit targetValue;

            if (animation.IsRelative)
            {
                targetValue = new Unit(Math.Abs(animation.By.Value), animation.By.Type);
                TargetValue = Math.Abs(animation.By.Value) == targetValue.Value ? "+=" : "-=";
            }
            else
                targetValue = new Unit(Math.Abs(animation.To.Value), animation.To.Type);

            TargetValue += targetValue.ToString();

        }
    }
}
